; ORIGINAL: 3dt2.1/examples/entstats.scm
; $Id: entstats.scm,v 1.4 1998/09/29 16:06:41 jmb Exp $
;-entstats.scm ----------------------------------------------------
; Display an entity's statistics.
;------------------------------------------------------------------
(define entity-stats
  (lambda ()
    (begin
      (format #t "Please pick an entity...\n")

      (let ((ent (pick:entity (read-ray))))
            (if (entity? ent)
          (begin
                  (format #t "wires:        ~a \n" (length (entity:wires ent)))
                  (format #t "lumps:        ~a \n" (length (entity:lumps ent)))
                  (format #t "shells:       ~a \n" (length (entity:shells ent)))
                  (format #t "faces:        ~a \n" (length (entity:faces ent)))
                  (format #t "loops:        ~a \n" (length (entity:loops ent)))
                  (format #t "edges:        ~a \n" (length (entity:edges ent)))
                  (format #t "vertices:     ~a \n" (length (entity:vertices ent)))
                  (format #t "type:         ~a \n" (entity:debug ent))
                  (format #t "displayed:    ~a \n" (entity:displayed? ent))
                  (format #t "faceted:      ~a \n" (entity:faceted? ent))
                  (format #t "highlighted:  ~a \n" (entity:highlighted? ent))
                  (format #t "material:     ~a \n" (entity:material ent))
                  (format #t "owner:        ~a \n" (entity:owner ent))
                  (format #t "bounding box: ~a \n" (entity:box ent))
                )
                (format #t "No entity selected\n")
        )
      ;; Return the selected entity
          ent))))
